package net.guerlab.smart.wx.service.service;

import net.guerlab.smart.platform.server.service.BaseFindService;
import net.guerlab.smart.wx.service.entity.WxUser;
import net.guerlab.smart.wx.service.entity.WxUserLoginLog;
import org.springframework.scheduling.annotation.Async;

/**
 * 微信用户登录记录服务
 *
 * @author guer
 */
public interface WxUserLoginLogService extends BaseFindService<WxUserLoginLog, Long> {

    /**
     * 添加登录记录
     *
     * @param user
     *         微信用户
     * @param ip
     *         IP
     * @param referer
     *         登录源
     */
    @Async
    void addLog(WxUser user, String ip, String referer);

    /**
     * 获取实体类型
     *
     * @return 实体类型
     */
    @Override
    default Class<WxUserLoginLog> getEntityClass() {
        return WxUserLoginLog.class;
    }
}
